//
//  EthereumTest.swift
//  MonujoTests
//
//  Created by user on 2024/1/2.
//

import Foundation
import XCTest
@testable import Monujo

class EthereumTest: XCTestCase {
    
    func test() {
        // test EIP55
        let checksumAddress = EthereumChain().eip55ChecksumAddress("0xfb6916095ca1df60bb79ce92ce3ea74c37c5d359")
        XCTAssertEqual(checksumAddress, "0xfB6916095ca1df60bB79Ce92cE3Ea74c37c5d359")
        let checksumAddress2 = EthereumChain().eip55ChecksumAddress("0xfB6916095ca1df60bB79Ce92cE3Ea74c37c5d359")
        XCTAssertEqual(checksumAddress2, "0xfB6916095ca1df60bB79Ce92cE3Ea74c37c5d359")
        
        // test isValidAddress
        XCTAssertTrue(EthereumChain().isValidEthereumAddress("0xfb6916095ca1df60bb79ce92ce3ea74c37c5d359"))
        XCTAssertFalse(EthereumChain().isValidEthereumAddress("0xfb6916095ca1df60bb79ce92ce3ea74c37c5d3590"))
        XCTAssertFalse(EthereumChain().isValidEthereumAddress("0xfb6916095ca1df60bb79ce9Zce3ea74c37c5d359"))
    }
    
}
